home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / a_utils / perl / perl5.ann / text0000.txt < prev   
Encoding:
Text File  |  1993-08-14  |  3.6 KB  |  140 lines

  1. I've put a tar of my current Perl 5 directory onto ftp.netlabs.com,
  2. in pub/outgoing/perl5.0/perl5a1.tar.Z.
  3.  
  4. Now's your chance to check out all the bugs I said I fixed in Perl 5.  :-)
  5.  
  6. Before you get all twitterpated, this is unsupported "alpha 1" code.
  7. There is no Configure, only a makefile.  It will probably only work on
  8. a Sun4.  The compiler and interpreter are still very much unoptimized
  9. (though it already runs as fast or faster than Perl 4).  It doesn't do
  10. everything that I want it to yet.  It doesn't have the OO stuff yet.
  11. It doesn't have "my" yet (though it's got the innards for it).  It
  12. doesn't have a debugger.
  13.  
  14. But it does have references, and you can play with them.  All the
  15. regression tests pass.  For your befuddlement, here's the op/ref.t test:
  16. ----------------------------------------------------
  17. #!./perl
  18.  
  19. print "1..24\n";
  20.  
  21. $bar = "ok 1\n";
  22. $foo = "ok 2\n";
  23. {
  24.     local(*foo) = *bar;
  25.     print $foo;
  26. }
  27. print $foo;
  28.  
  29. $baz = "ok 3\n";
  30. $foo = "ok 4\n";
  31. {
  32.     local(*foo) = 'baz';
  33.     print $foo;
  34. }
  35. print $foo;
  36.  
  37. $foo = "ok 6\n";
  38. {
  39.     local(*foo);
  40.     print $foo;
  41.     $foo = "ok 5\n";
  42.     print $foo;
  43. }
  44. print $foo;
  45.  
  46. $baz = "ok 7\n";
  47. $bar = 'baz';
  48. $foo = 'bar';
  49. print $$$foo;
  50.  
  51. $BAZ = "ok 8\n";
  52. $BAR = \$BAZ;
  53. $FOO = \$BAR;
  54. print $$$FOO;
  55.  
  56. @ary = (9,10,11,12);
  57. $ref[0] = \@a;
  58. $ref[1] = \@b;
  59. $ref[2] = \@c;
  60. $ref[3] = \@d;
  61. for $i (3,1,2,0) {
  62.     push(@{$ref[$i]}, "ok $ary[$i]\n");
  63. }
  64. print @a;
  65. print ${$ref[1]}[0];
  66. print @{$ref[2]}[0];
  67. print @{'d'};
  68.  
  69. $refref = \\$x;
  70. $x = "ok 13\n";
  71. print $$$refref;
  72.  
  73. $ref = [[],2,[3,4,5,]];
  74. print scalar @$ref == 3 ? "ok 14\n" : "not ok 14\n";
  75. print $$ref[1] == 2 ? "ok 15\n" : "not ok 15\n";
  76. print ${$$ref[2]}[2] == 5 ? "ok 16\n" : "not ok 16\n";
  77. print scalar @{$$ref[0]} == 0 ? "ok 17\n" : "not ok 17\n";
  78.  
  79. print $ref->[1] == 2 ? "ok 18\n" : "not ok 18\n";
  80. print $ref->[2]->[0] == 3 ? "ok 19\n" : "not ok 18\n";
  81.  
  82. $refref = \%whatever;
  83. $refref->{"key"} = $ref;
  84. print $refref->{"key"}->[2]->[0] == 3 ? "ok 20\n" : "not ok 20\n";
  85.  
  86. $spring[5]->[0] = 123;
  87. $spring[5]->[1] = 456;
  88. push(@{$spring[5]}, 789);
  89. print join(':',@{$spring[5]}) eq "123:456:789" ? "ok 21\n" : "not ok 21\n";
  90.  
  91. @{$spring2{"foo"}} = (1,2,3);
  92. $spring2{"foo"}->[3] = 4;
  93. print join(':',@{$spring2{"foo"}}) eq "1:2:3:4" ? "ok 22\n" : "not ok 22\n";
  94.  
  95. sub mysub { print "ok 23\n" }
  96. $subref = \&mysub;
  97. &$subref;
  98.  
  99. $subrefref = \\&mysub2;
  100. &$$subrefref("ok 24\n");
  101. sub mysub2 { print shift }
  102. --------------------------------------------------------------
  103. All that gobbledygook works, believe it or not.  For fun, run it through
  104. perl -Dxst.
  105.  
  106. I smell some new JAPHs coming...
  107.  
  108. I don't want to get stuck "supporting" this, but if you want to run your
  109. favorite scripts past it and see which ones toss their salad, you may.
  110. If you can come up with a decent bug report with a small test case, I'll
  111. certainly be glad to look at it.  I'm not really interested in obscure
  112. core dumps at the moment.  I'm still getting plenty of those on my own.
  113.  
  114. I'm not yet interested in memory leak reports either.
  115.  
  116. I can tell you that no program that uses the old autoloading
  117. mechanism will run, since there is no visibility into the
  118. symbol table pointers currently.  You ought to be able to redefine
  119. a subroutine while it's running, though.  (I haven't tested that in
  120. several months, however.  There oughta be a regression test for that...)
  121.  
  122. Don't bother trying to diff Perl 4 with Perl 5.  Everything is different.
  123. All names have been regularized.  Here's a key, if you're brave and
  124. want to peek at the sources:
  125.  
  126.     SV    scalar value
  127.     AV    array value
  128.     HV    hash value
  129.     GV    glob value
  130.     CV    code value
  131.     RV    reference value
  132.     PV    pointer value
  133.     NV    numeric value
  134.     IV    integer value
  135.  
  136. I'm going to be in New Jersey next week, so don't expect quick replies.
  137.  
  138. Larry
  139.  
  140.